Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class Microsoft.​Extensions.​Options.​OptionsMonitor<​TOptions>
Assembly: Microsoft.Extensions.Options
Inheritance: object → OptionsMonitor
Implemented Interfaces
Implements <see cref="T:Microsoft.Extensions.Options.IOptionsMonitor`1" /> .
Properties
public
TOptions
CurrentValue
Gets the present value of the options (equivalent to <c>Get(Options.DefaultName)</c> ).
Methods
public
void
Dispose​()
Removes all change registration subscriptions.
public
TOptions
Get​(string name)
Returns a configured <typeparamref name="TOptions" /> instance with the given <paramref name="name" /> .
Returns The <typeparamref name="TOptions" /> instance that matches the given <paramref name="name" /> .
name
The name of the <typeparamref name="TOptions" /> instance. If <see langword="null" /> , <see cref="F:Microsoft.Extensions.Options.Options.DefaultName" /> , which is the empty string, is used.
OnChange​(System.​Action<​TOptions, string> listener)
Registers a listener to be called whenever <typeparamref name="TOptions" /> changes.
Returns An <see cref="T:System.IDisposable" /> that should be disposed to stop listening for changes.
listener
The action to be invoked when <typeparamref name="TOptions" /> has changed.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object